package com.tanyin.demo.shiyan4;

import lombok.Data;

/**
 * @author xdf
 * @date 2024-05-19
 */
@Data
public class Body {
  private CarType carType;
  private Material material;
  private CarGate[] carGates = new CarGate[4];
  private Rearview rearview;
  private Seat[] seats=new Seat[4];

  public void getInfo() {
    carType.getInfo();
    material.getInfo();
    for (int i = 1; i <= 4; i++) {
      System.out.print("第" + i + "车门");
      System.out.print(carGates[i - 1].getInfo()+" ");
    }
    System.out.println();
    rearview.getInfo();
    for (int i = 1; i <= 4; i++) {
      System.out.print("第" + i + "座椅");
      seats[i - 1].getInfo();
    }
  }
}
